package com.zhixue.content.feignclient;

import com.zhixue.content.config.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Auther: 李 力
 * @Date: 2025/5/7
 * @Description: com.zhixue.content.feignclient
 * @version: 1.0
 */
@FeignClient(value = "media-api", configuration = {MultipartSupportConfig.class}, path = "/media", fallbackFactory = MediaServiceClientFallbackFactory.class)
public interface MediaServiceClient {

    @PostMapping(value = "/upload/coursefile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public String upload(@RequestPart("filedata") MultipartFile filedata,
                         @RequestParam(value = "objectName", required = false) String objectName
    );
}
